import {TitleMarker, TitleMarkerItem, TitleMarkerName} from "@/components/TipMarker";
import dayjs from 'dayjs';
import {
    ALL,
    CULTURAL,
    INDUSTRY_TRAVEL,
    INTANGIBLE_PROTECTION,
    LIBRARY,
    MUSEUM,
    SCENIC,
    VILLAGE
} from "@/enums/ResourceType";
import {ApplicationConfigMap, defineAppConfig} from "@/config/interface";

/**
 * 14 金坛
 */
const Config: ApplicationConfigMap = defineAppConfig('23', {
    map: {
        center: [108.19, 22.49],
        zoom: 12,
        components: {
            resource: {
                types: [ALL, SCENIC, VILLAGE, INDUSTRY_TRAVEL, MUSEUM, LIBRARY, CULTURAL, INTANGIBLE_PROTECTION],
                modals: {
                    //景区弹窗
                    [SCENIC]: {
                        title: "{name}",
                        tabs: [
                            {
                                label: "主页",
                                url: "https://shuzhi-public.tourage.cn/resourceModel/scenic?apiURL={apiUrl}&id={id}&token={token}",
                                height: 635
                            },
                            {
                                label: "视频监控",
                                url: "https://shuzhi-public.tourage.cn/video?apiURL={apiUrl}&zoneCode={zoneCode}&type=scenic&name={name}&token={token}",
                                height: 631
                            }
                        ]
                    },
                }
            },
            scenic: { //景区配置
                marker: {
                    render: (item: any) => <TitleMarker content={
                        <>
                            <TitleMarkerName name={item.name}/>
                            <TitleMarkerItem title="累计客流：" color="#F7B500" count={item.current || 0} unit="人"/>
                        </>
                    }/>,
                    offsetHeight: -117
                }
            },
        },
    },
    analyse: {
        scenicTourist: {
            defaultScopeValue: {
                date: dayjs().add(-1, 'day'),
                month: dayjs().add(-1, 'month')
            },
            defaultValues: {
                scope: 'date',
                date: dayjs().subtract(1, 'day'),
            }
        },
    }
})

export default Config;